<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>date</title>
		<script>
		var t;
		 function initTime(){
			 showTime();
			 t=window.setInterval("showTime()",1000);
		 }
		
		function showTime(){
			var d=new Date();
			document.getElementById("timer").innerHTML=d.toLocaleString();
		}
		function stopTime(){
			window.clearInterval(t);
		}
		</script>
	</head>
	<body onload="initTime()">
		<div id="timer">
			
		</div>
		<input type="button" value="Stop" onclick="stopTime()"/>
	</body>
</html>
